Integrand size = 32, antiderivative size = 747 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\frac {B^2 (b c-a d)^2 g^2 n^2 (c+d x)}{3 (b f-a g)^2 (d f-c g)^3 (f+g x)}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g) (d f-c g)^3 (f+g x)^2}+\frac {2 B (b c-a d) g (3 b d f-b c g-2 a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g)^3 (d f-c g)^2 (f+g x)}+\frac {b^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (b f-a g)^3}-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}-\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-b c g-2 a d g) n^2 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \operatorname {PolyLog}\left (2,\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3} \]
[Out]
Time = 1.05 (sec) , antiderivative size = 747, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {2553, 2398, 2404, 2338, 2356, 46, 2351, 31, 2354, 2438} \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\frac {2 B n (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (c^2 g^2-3 c d f g+3 d^2 f^2\right )\right ) \log \left (1-\frac {(a+b x) (d f-c g)}{(c+d x) (b f-a g)}\right ) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 n^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (c^2 g^2-3 c d f g+3 d^2 f^2\right )\right ) \operatorname {PolyLog}\left (2,\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {b^3 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{3 g (b f-a g)^3}-\frac {B g^2 n (c+d x)^2 (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 (f+g x)^2 (b f-a g) (d f-c g)^3}-\frac {\left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )^2}{3 g (f+g x)^3}+\frac {2 B g n (a+b x) (b c-a d) (-2 a d g-b c g+3 b d f) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{3 (f+g x) (b f-a g)^3 (d f-c g)^2}+\frac {B^2 g^2 n^2 (c+d x) (b c-a d)^2}{3 (f+g x) (b f-a g)^2 (d f-c g)^3}+\frac {B^2 g^2 n^2 (b c-a d)^3 \log \left (\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}-\frac {B^2 g^2 n^2 (b c-a d)^3 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 g n^2 (b c-a d)^2 (-2 a d g-b c g+3 b d f) \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3} \]
[In]
[Out]
Rule 31
Rule 46
Rule 2338
Rule 2351
Rule 2354
Rule 2356
Rule 2398
Rule 2404
Rule 2438
Rule 2553
Rubi steps \begin{align*} \text {integral}& = (b c-a d) \text {Subst}\left (\int \frac {(b-d x)^2 \left (A+B \log \left (e x^n\right )\right )^2}{(b f-a g-(d f-c g) x)^4} \, dx,x,\frac {a+b x}{c+d x}\right ) \\ & = -\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {(2 B n) \text {Subst}\left (\int \frac {(b-d x)^3 \left (A+B \log \left (e x^n\right )\right )}{x (b f-a g+(-d f+c g) x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 g} \\ & = -\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {(2 B n) \text {Subst}\left (\int \left (\frac {b^3 \left (A+B \log \left (e x^n\right )\right )}{(b f-a g)^3 x}+\frac {(-b c+a d)^3 g^3 \left (A+B \log \left (e x^n\right )\right )}{(b f-a g) (d f-c g)^2 (b f-a g-(d f-c g) x)^3}+\frac {(b c-a d)^2 g^2 (3 b d f-b c g-2 a d g) \left (A+B \log \left (e x^n\right )\right )}{(b f-a g)^2 (d f-c g)^2 (b f-a g-(d f-c g) x)^2}+\frac {(b c-a d) g \left (-a^2 d^2 g^2+a b d g (3 d f-c g)-b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) \left (A+B \log \left (e x^n\right )\right )}{(b f-a g)^3 (d f-c g)^2 (b f-a g-(d f-c g) x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{3 g} \\ & = -\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {\left (2 b^3 B n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 g (b f-a g)^3}-\frac {\left (2 B (b c-a d)^3 g^2 n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{(b f-a g+(-d f+c g) x)^3} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g) (d f-c g)^2}+\frac {\left (2 B (b c-a d)^2 g (3 b d f-b c g-2 a d g) n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{(b f-a g+(-d f+c g) x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^2 (d f-c g)^2}-\frac {\left (2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n\right ) \text {Subst}\left (\int \frac {A+B \log \left (e x^n\right )}{b f-a g+(-d f+c g) x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^2} \\ & = -\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g) (d f-c g)^3 (f+g x)^2}+\frac {2 B (b c-a d) g (3 b d f-b c g-2 a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g)^3 (d f-c g)^2 (f+g x)}+\frac {b^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (b f-a g)^3}-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {\left (B^2 (b c-a d)^3 g^2 n^2\right ) \text {Subst}\left (\int \frac {1}{x (b f-a g+(-d f+c g) x)^2} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g) (d f-c g)^3}-\frac {\left (2 B^2 (b c-a d)^2 g (3 b d f-b c g-2 a d g) n^2\right ) \text {Subst}\left (\int \frac {1}{b f-a g+(-d f+c g) x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^2}-\frac {\left (2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {(-d f+c g) x}{b f-a g}\right )}{x} \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3} \\ & = -\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g) (d f-c g)^3 (f+g x)^2}+\frac {2 B (b c-a d) g (3 b d f-b c g-2 a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g)^3 (d f-c g)^2 (f+g x)}+\frac {b^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (b f-a g)^3}-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-b c g-2 a d g) n^2 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \text {Li}_2\left (\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {\left (B^2 (b c-a d)^3 g^2 n^2\right ) \text {Subst}\left (\int \left (\frac {1}{(b f-a g)^2 x}+\frac {d f-c g}{(b f-a g) (b f-a g-(d f-c g) x)^2}+\frac {d f-c g}{(b f-a g)^2 (b f-a g-(d f-c g) x)}\right ) \, dx,x,\frac {a+b x}{c+d x}\right )}{3 (b f-a g) (d f-c g)^3} \\ & = \frac {B^2 (b c-a d)^2 g^2 n^2 (c+d x)}{3 (b f-a g)^2 (d f-c g)^3 (f+g x)}-\frac {B (b c-a d) g^2 n (c+d x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g) (d f-c g)^3 (f+g x)^2}+\frac {2 B (b c-a d) g (3 b d f-b c g-2 a d g) n (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{3 (b f-a g)^3 (d f-c g)^2 (f+g x)}+\frac {b^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (b f-a g)^3}-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{3 g (f+g x)^3}+\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {a+b x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}-\frac {B^2 (b c-a d)^3 g^2 n^2 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 (b c-a d)^2 g (3 b d f-b c g-2 a d g) n^2 \log \left (\frac {f+g x}{c+d x}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log \left (1-\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3}+\frac {2 B^2 (b c-a d) \left (a^2 d^2 g^2-a b d g (3 d f-c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n^2 \text {Li}_2\left (\frac {(d f-c g) (a+b x)}{(b f-a g) (c+d x)}\right )}{3 (b f-a g)^3 (d f-c g)^3} \\ \end{align*}
Time = 1.63 (sec) , antiderivative size = 918, normalized size of antiderivative = 1.23 \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=-\frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2+\frac {B n (f+g x) \left ((b c-a d) g (b f-a g)^2 (d f-c g)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 (b c-a d) g (b f-a g) (-d f+c g) (-2 b d f+b c g+a d g) (f+g x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-2 b^3 (d f-c g)^3 (f+g x)^2 \log (a+b x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+2 d^3 (b f-a g)^3 (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (c+d x)-2 (b c-a d) g \left (a^2 d^2 g^2+a b d g (-3 d f+c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) (f+g x)^2 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \log (f+g x)-2 B (b c-a d) g (2 b d f-b c g-a d g) n (f+g x)^2 (b (d f-c g) \log (a+b x)+(-b d f+a d g) \log (c+d x)+(b c-a d) g \log (f+g x))+B (b c-a d) g n (f+g x) \left ((b c-a d) g (b f-a g) (d f-c g)-b^2 (d f-c g)^2 (f+g x) \log (a+b x)+d^2 (b f-a g)^2 (f+g x) \log (c+d x)+(b c-a d) g (-2 b d f+b c g+a d g) (f+g x) \log (f+g x)\right )+b^3 B (d f-c g)^3 n (f+g x)^2 \left (\log (a+b x) \left (\log (a+b x)-2 \log \left (\frac {b (c+d x)}{b c-a d}\right )\right )-2 \operatorname {PolyLog}\left (2,\frac {d (a+b x)}{-b c+a d}\right )\right )-B d^3 (b f-a g)^3 n (f+g x)^2 \left (\left (2 \log \left (\frac {d (a+b x)}{-b c+a d}\right )-\log (c+d x)\right ) \log (c+d x)+2 \operatorname {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )\right )+2 B (b c-a d) g \left (a^2 d^2 g^2+a b d g (-3 d f+c g)+b^2 \left (3 d^2 f^2-3 c d f g+c^2 g^2\right )\right ) n (f+g x)^2 \left (\left (\log \left (\frac {g (a+b x)}{-b f+a g}\right )-\log \left (\frac {g (c+d x)}{-d f+c g}\right )\right ) \log (f+g x)+\operatorname {PolyLog}\left (2,\frac {b (f+g x)}{b f-a g}\right )-\operatorname {PolyLog}\left (2,\frac {d (f+g x)}{d f-c g}\right )\right )\right )}{(b f-a g)^3 (d f-c g)^3}}{3 g (f+g x)^3} \]
[In]
[Out]
\[\int \frac {{\left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )}^{2}}{\left (g x +f \right )^{4}}d x\]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{4}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{4}} \,d x } \]
[In]
[Out]
\[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\int { \frac {{\left (B \log \left (e \left (\frac {b x + a}{d x + c}\right )^{n}\right ) + A\right )}^{2}}{{\left (g x + f\right )}^{4}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )^2}{(f+g x)^4} \, dx=\int \frac {{\left (A+B\,\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\right )}^2}{{\left (f+g\,x\right )}^4} \,d x \]
[In]
[Out]